ViewDragHelper
(SESL variant) ViewDragHelper is a utility class for writing custom ViewGroups. It offers a number of useful operations and state tracking for allowing a user to drag and reposition views within their parent ViewGroup.
Types
Properties
Link copied to clipboard
Indicates that a check should occur along all axes
Link copied to clipboard
Indicates that a check should occur along the horizontal axis
Link copied to clipboard
Indicates that a check should occur along the vertical axis
Link copied to clipboard
Edge flag indicating that the bottom edge should be affected.
Link copied to clipboard
Edge flag indicating that the right edge should be affected.
Link copied to clipboard
A null/invalid pointer ID.
Link copied to clipboard
A view is currently being dragged.
Link copied to clipboard
A view is not currently being dragged or animating as a result of a fling/snap.
Link copied to clipboard
A view is currently settling into place as a result of a fling or predefined non-interactive motion.
Functions
Link copied to clipboard
The result of a call to this method is equivalent to processTouchEvent receiving an ACTION_CANCEL event.
Link copied to clipboard
Capture a specific child view for dragging within the parent.
Link copied to clipboard
Check if any pointer tracked in the current gesture has crossed the required slop threshold.
Check if the specified pointer tracked in the current gesture has crossed the required slop threshold.
Link copied to clipboard
Move the captured settling view by the appropriate amount for the current time.
Link copied to clipboard
@NonNull
@NonNull
Factory method to create a new ViewDragHelper.
Link copied to clipboard
Find the topmost child under the given point within the parent view's coordinate system.
Link copied to clipboard
Settle the captured view based on standard free-moving fling behavior.
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
Return the default size used for edge tracking.
Link copied to clipboard
Return the size of an edge.
Link copied to clipboard
Return the currently configured minimum velocity.
Link copied to clipboard
Link copied to clipboard
Retrieve the current drag state of this helper.
Link copied to clipboard
Determine if the currently captured view is under the given point in the parent view's coordinate system.
Link copied to clipboard
Check if any of the edges specified were initially touched in the currently active gesture.
Check if any of the edges specified were initially touched by the pointer with the specified ID.
Link copied to clipboard
Check if the given pointer ID represents a pointer that is currently down (to the best of the ViewDragHelper's knowledge).
Link copied to clipboard
Determine if the supplied view is under the given point in the parent view's coordinate system.
Link copied to clipboard
Process a touch event received by the parent view.
Link copied to clipboard
@NonNull
Factory method to create a new ViewDragHelper.
Link copied to clipboard
Sets whether to update the left and right offsets of the captured view during dragging and settling.
Link copied to clipboard
Set the range in pixels along the edges of this view that will actively detect edge touches or drags if edge tracking is enabled.
Link copied to clipboard
Enable edge tracking for the selected edges of the parent view.
Link copied to clipboard
Set the minimum velocity that will be detected as having a magnitude greater than zero in pixels per second.
Link copied to clipboard
Settle the captured view at the given (left, top) position.
Link copied to clipboard
Link copied to clipboard
Check if this event as provided to the parent view's onInterceptTouchEvent should cause the parent to intercept the touch event stream.
Link copied to clipboard
open fun smoothSlideViewTo(@NonNull child: @NonNull View, finalLeft: Int, finalTop: Int, duration: Int, @Nullable interpolator: @Nullable Interpolator): Boolean
Animate the view
child
to the given (left, top) position.